package com.wxapp.dispatch.service.controller;

import com.wxapp.common.constant.base.IBaseController;
import com.wxapp.common.constant.pojo.vm.PEnumVm;
import com.wxapp.common.constant.pojo.vm.ResultVm;
import com.wxapp.common.util.enums.EnumUtil;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * Description
 * @author lgl
 * DateTime  2024/1/15 10:17
 * Modified By
 */
@RestController
@RequestMapping("/enum")
@Tag(name = "枚举管理")
@RequiredArgsConstructor
public class EnumController extends IBaseController {

    @GetMapping("/getList/{name}")
    @Operation(summary ="获取枚举下拉列表")
    public ResultVm<List<PEnumVm>> getList(@PathVariable String name) {
      return  success(EnumUtil.getEnumByClass(name));
    }
}
